import request from '@/utils/request'

const apiUrl = '/domain-name'

export function getList(params) {
  return request({
    url: apiUrl,
    method: 'get',
    params
  }).then(res => {
    return res.data
  })
}

export function getInfo(id) {
  return request({
    url: apiUrl + '/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: apiUrl,
    method: 'post',
    data
  })
}

export function update(id, data) {
  return request({
    url: apiUrl + '/' + id,
    method: 'put',
    data
  })
}

export function remove(id) {
  return request({
    url: apiUrl + '/' + id,
    method: 'delete'
  })
}
